#ifndef __CANYON_CORE_CODEPOINTER
#define __CANYON_CORE_CODEPOINTER

#include "arch.hpp"
#include "memory.hpp"

namespace canyon{

class CodePointer{
    protected:
    Memory *memory;
    size_t  now;
    
    public:
    
    CodePointer(Memory *memory, size_t entrypoint){
        this->memory = memory;
        this->now    = entrypoint;
    }
    
    void jump(size_t entrypoint){
        this->now = entrypoint;
    }

    void next(size_t step=sizeof(command)){
        this->now += step;
    }

    command get_command(){
        return this->memory->get_command(this->now);
    }

    size_t get(){
        return this->now;
    }
};

}

#endif
